home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / vsrc.tar / voyager7_src / ta.c < prev    next >
C/C++ Source or Header  |  1991-02-27  |  1KB  |  92 lines

  1. /*
  2. // Abstract:
  3. //    TA.C
  4. //
  5. // Author:
  6. //    Derek S. Nickel
  7. //
  8. // Creation date:
  9. //    25 October 1990
  10. //
  11. // History:
  12. // V01-001    Derek S. Nickel        25-OCT-1990
  13. //    Original.
  14. //
  15. */
  16.  
  17. #include <ctype.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20. #include <io.h>
  21.  
  22. #include "memory.h"
  23. #include "commands.h"
  24. #include "modes.h"
  25. #include "objects.h"
  26. #include "instruct.h"
  27. #include "ports.h"
  28.  
  29. /***********************************************************************
  30.     unany
  31. ***********************************************************************/
  32.  
  33. void unany(char *subcmds)
  34. {
  35.     int i, stop = 0;
  36.     int limit;
  37.     int ua_limit;
  38.     int ut_limit;
  39.  
  40.     /*
  41.     // Set up unassemble/unthread limits.
  42.     */
  43.  
  44.     ua_limit = modes.limit;
  45.     ut_limit = 1;
  46.     limit = (modes.unmode ? ua_limit : ut_limit);
  47.  
  48.     /*
  49.     // Unassemble or unthread, switching as needed.
  50.     */
  51.  
  52.     i = 0;
  53.  
  54.     while (i < limit && !(stop && modes.stop)) {
  55.  
  56.         i++;
  57.  
  58.         if (modes.unmode) {
  59.             /*
  60.             // Unassemble the current instruction.
  61.             */
  62.  
  63.             unassem1instr(&stop);
  64.  
  65.             /*
  66.             // If switching to unthread mode...
  67.             */
  68.  
  69.             if (!modes.unmode) {
  70.                 limit = ut_limit;
  71.                 i = 0;
  72.             }
  73.  
  74.         } else {
  75.             /*
  76.             // Display the current RPL object.
  77.             */
  78.  
  79.             modes.unmode = display_current_object(&stop);
  80.  
  81.             /*
  82.             // If switching to unassemble mode...
  83.             */
  84.  
  85.             if (modes.unmode) {
  86.                 limit = ua_limit;
  87.                 i = 0;
  88.             }
  89.         }
  90.     }
  91. }
  92.